package com.kundi.dooradmin.service;

import com.kundi.dooradmin.entity.Success;
import com.kundi.dooradmin.mapper.SuccessMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Author 赵恒
 * Date 2020/6/24
 */
@Service
public class SuccessService {
    @Resource
    SuccessMapper successMapper;


    public Success getSuccessById(Integer id) {
        Success success = new Success();
        success.setId(id);
        return successMapper.selectByPrimaryKey(success);
    }

    public Integer insert(Success success) {
        return successMapper.insertSelective(success);
    }

    public List<Success> getAll() {
        return successMapper.selectAll();
    }

    public Integer update(Success success) {
        return successMapper.updateByPrimaryKey(success);
    }
}
